﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RestSharp;

namespace QntPlatform.BinanceApi.DApi
{
    public partial class DApiClient
    {
        
        public Task< IRestResponse<List<Balance>>> GetBalance()
        {
            return CreateReq(Prefix+ "balance").GetAsync<List<Balance>>();
        }

    }
 
 /**
   {
        "accountAlias": "SgsR",    // 账户唯一识别码
        "asset": "BTC",     // 资产
        "balance": "0.00250000",    // 账户余额
        "withdrawAvailable": "0.00250000", // 最大可提款金额,同`GET /dapi/account`中"maxWithdrawAmount"
        "crossWalletBalance": "0.00241969", // 全仓账户余额
        "crossUnPnl": "0.00000000", // 全仓持仓未实现盈亏
        "availableBalance": "0.00241969",    // 可用下单余额
        "updateTime": 1592468353979
    }
 */
    public class Balance : DApiDto
    {
        public string accountAlias { get; set; }
        public string asset { get; set; }
        public decimal balance { get; set; }
        public decimal withdrawAvailable { get; set; }
        public decimal crossWalletBalance { get; set; }
        public decimal crossUnPnl { get; set; }
        public decimal availableBalance { get; set; }
        public long updateTime { get; set; }
    }

}
